//
// CAnimation.java
// Copyright (C) 2010  "Naush" <naush _ hotmail _ fr>
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU Affero General Public License as
// published by the Free Software Foundation, either version 3 of the
// License, or (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
// GNU Affero General Public License for more details.
//
// You should have received a copy of the GNU Affero General Public License
// along with this program.  If not, see <http://www.gnu.org/licenses/>./* ----------------------------------------------------------------------------







package org.ryzom.nel.threed;

import org.ryzom.nel.misc.IStream;

public class CAnimation {
  private long swigCPtr;
  protected boolean swigCMemOwn;

  public CAnimation(long cPtr, boolean cMemoryOwn) {
    swigCMemOwn = cMemoryOwn;
    swigCPtr = cPtr;
  }

  public static long getCPtr(CAnimation obj) {
    return (obj == null) ? 0 : obj.swigCPtr;
  }

  protected void finalize() {
    delete();
  }

  public synchronized void delete() {
    if (swigCPtr != 0) {
      if (swigCMemOwn) {
        swigCMemOwn = false;
        nel3dJNI.delete_CAnimation(swigCPtr);
      }
      swigCPtr = 0;
    }
  }

  public CAnimation() {
    this(nel3dJNI.new_CAnimation(), true);
  }

  public long getIdTrackByName(String name) {
    return nel3dJNI.CAnimation_getIdTrackByName(swigCPtr, this, name);
  }

  public void getTrackNames(SWIGTYPE_p_std__setT_std__string_t setString) {
    nel3dJNI.CAnimation_getTrackNames(swigCPtr, this, SWIGTYPE_p_std__setT_std__string_t.getCPtr(setString));
  }

  public long getIdTrackByChannelId(long channelId) {
    return nel3dJNI.CAnimation_getIdTrackByChannelId(swigCPtr, this, channelId);
  }

  public ITrack getTrack(long trackId) {
    long cPtr = nel3dJNI.CAnimation_getTrack__SWIG_0(swigCPtr, this, trackId);
    return (cPtr == 0) ? null : new ITrack(cPtr, false);
  }

  public void addTrack(String name, ITrack pChannel) {
    nel3dJNI.CAnimation_addTrack(swigCPtr, this, name, ITrack.getCPtr(pChannel), pChannel);
  }

  public void serial(IStream f) {
    nel3dJNI.CAnimation_serial(swigCPtr, this, IStream.getCPtr(f), f);
  }

  public void setMinEndTime(SWIGTYPE_p_TAnimationTime minEndTime) {
    nel3dJNI.CAnimation_setMinEndTime(swigCPtr, this, SWIGTYPE_p_TAnimationTime.getCPtr(minEndTime));
  }

  public UTrack getTrackByName(String name) {
    long cPtr = nel3dJNI.CAnimation_getTrackByName(swigCPtr, this, name);
    return (cPtr == 0) ? null : new UTrack(cPtr, false);
  }

  public void releaseTrack(UTrack track) {
    nel3dJNI.CAnimation_releaseTrack(swigCPtr, this, UTrack.getCPtr(track), track);
  }

  public SWIGTYPE_p_TAnimationTime getBeginTime() {
    return new SWIGTYPE_p_TAnimationTime(nel3dJNI.CAnimation_getBeginTime(swigCPtr, this), true);
  }

  public SWIGTYPE_p_TAnimationTime getEndTime() {
    return new SWIGTYPE_p_TAnimationTime(nel3dJNI.CAnimation_getEndTime(swigCPtr, this), true);
  }

  public boolean allTrackLoop() {
    return nel3dJNI.CAnimation_allTrackLoop(swigCPtr, this);
  }

  public void addSSSShape(String shape) {
    nel3dJNI.CAnimation_addSSSShape(swigCPtr, this, shape);
  }

  public Vector_String getSSSShapes() {
    return new Vector_String(nel3dJNI.CAnimation_getSSSShapes(swigCPtr, this), false);
  }

  public void applySampleDivisor(long sampleDivisor) {
    nel3dJNI.CAnimation_applySampleDivisor(swigCPtr, this, sampleDivisor);
  }

  public void applyTrackQuatHeaderCompression() {
    nel3dJNI.CAnimation_applyTrackQuatHeaderCompression(swigCPtr, this);
  }

  public void applyAnimHeaderCompression(CAnimationSet animationSetOwner, SWIGTYPE_p_std__mapT_std__string_unsigned_int_t channelMap) {
    nel3dJNI.CAnimation_applyAnimHeaderCompression(swigCPtr, this, CAnimationSet.getCPtr(animationSetOwner), animationSetOwner, SWIGTYPE_p_std__mapT_std__string_unsigned_int_t.getCPtr(channelMap));
  }

  public final static int NotFound = nel3dJNI.CAnimation_NotFound_get();

}
